#ifndef DATASAVE_H
#define DATASAVE_H

#include <QByteArray>
#include <QFile>
#include <QObject>

class DataSave : public QObject {
    Q_OBJECT
  public:
    explicit DataSave(QObject* parent = nullptr);
    ~DataSave();

  private:
    QFile saveFile;

    bool save_flag;

    bool stamp_flag = false;  // 设置初值为false，对应ckeckbox初始状态

    void SaveOpen();
    void SaveClose();

  public slots:
    void do_rcv_save(QByteArray);
    void do_setSaveFlag(bool);
    void do_setStampFlag(bool);
    void do_CloseFile();
  signals:
    void sig_fileNotOpen();
    void sig_fileIsOpen();
};

#endif  // DATASAVE_H
